package it.polimi.meteocal.web.beans;

import it.polimi.meteocal.ejb.notificationmanagement.NotificationMgr;

import java.util.List;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

@ManagedBean (name="notificationBean")
@SessionScoped
public class NotificationBean {

	@EJB
	private NotificationMgr notificationMgr;

	private List<?> result;
	
	public String findByUser(){
		result = notificationMgr.findByUser();
		return "notification?faces-redirect=true";
	}

	public NotificationMgr getNotificationMgr() {
		return notificationMgr;
	}

	public void setNotificationMgr(NotificationMgr notificationMgr) {
		this.notificationMgr = notificationMgr;
	}

	public List<?> getResult() {
		return result;
	}

	public void setResult(List<?> result) {
		this.result = result;
	}
	
	public void delete(int notificationid){
		notificationMgr.delete(notificationid);
	}
	
}
